<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset='utf-8'" />
  <meta name="keywords" content="<%= @settings.keywords.to_s %>" />
  <title><%= @settings.title %>:&nbsp;<%= controller.action_name %></title>
  <link rel="alternate" type="application/rss+xml" href="media/rss" />
  <%= theme_stylesheet_link_tag session[:loadedsettings]["theme"]+".css" %>
  <%= javascript_include_tag :defaults %>
  <%= theme_javascript_include_tag "rico.js"%>
</head>
<body>
<div id="container">
  <div id="header">
    <h1><%= link_to h(@settings.title), :controller=>"media",:action=>"index" %></h1>
    <h2><%=h @settings.subtitle %></h2>
  </div>

  <div id="page">
    <div id="content">
      <p style="color: red"><%= flash[:notice] %></p>
      <%= yield %>
    </div>

    <div id="sidebar">
	<div id="extensions">
	    <div id="accordionDiv">	
        	<% @exts=Extplugin.find(:all,:conditions=>{:activated=>1},:order=>"`extplugins`.`order` ASC") %>
        	<% for item in @exts %>
		    <% @config=Extplugin.find_by_name(item.name.to_s).config -%>
		    <div id="overviewPanel">
            		<div id="overviewHeader">
            		    <%= @config["title"] %>
            		</div>
			<div id="panelContent">
            		    <%= render_component(:controller => 'plugin/'+item.name.to_s,:action =>'show') %>
            		</div>
        	    </div>
        	<% end %>
		<% if session[:user]!=nil %>
    		    <div id="overviewPanel">
            		<div id="overviewHeader">
			    Admin
			</div>
			<div id="panelContent">
    			    <%= render_component(:controller => 'admin/menu',:action =>'show') %>
			</div>
    		    </div>
		<% end %>
	    </div>
        </div>
	<script>
	    new Rico.Accordion( $('accordionDiv') ,{expandedBg:'#0066cc',collapsedBg:'#0066cc', hoverBg:'#0066cc',borderColor: '#0066cc',hoverTextColor: '#ffffff',expandedTextColor   : '#ffffff',collapsedTextColor   : '#e0e0e0'} );
        </script>
    
    
    </div>
    </div>
    <br style="clear:both;" />
  </div>

  <div id="footer">
    <a onclick="new Effect.ScrollTo('topbar'); return false"><%= theme_image_tag("arrow_up.png",:border =>0) %></a>
    <%= link_to image_tag("mandarina.png",:align=>"bottom",:border=>0,:title=>"mandarina blog code"),"http://code.google.com/p/mandarinablog/" %>&nbsp;<a href="/media/rss"><%= theme_image_tag("feed.png",:align=>"bottom",:border=>0) %></a>&nbsp;<a href="http://www.famfamfam.com/lab/icons/silk/"><%= theme_image_tag("images.png",:border =>0,:align=>"bottom",:alt=>"famfamfam silk icons") %></a>
  </div>
</div>
</body>
</html>